Skip to content

Refactor Application Settings and Support for Packaged/Unpackaged Mode #1924 #2014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

ghost1372
Copy link
Contributor

@ghost1372 ghost1372 commented Aug 7, 2025

This PR replaces the legacy ApplicationData-based settings system with a new SettingsHelper class. It adds support for both packaged and unpackaged app scenarios.

Closes #1924.

Old Settings System:

appData.LocalSettings.Values[SettingsKeys.IsLeftMode] = true;
New Settings System:

SettingsHelper.Current.IsLeftMode = true;

Note

Settings are automatically saved when changed.

SettingsHelper Architecture:

Uses an ISettingsProvider abstraction.
In packaged mode: uses ApplicationDataContainer.
In unpackaged mode: uses JsonSettingsProvider.

Adding a New Setting:

public bool IsEnabled
{
    get => GetOrCreateDefault<bool>(true);
    set => Set(value);
}

ghost1372 referenced this pull request Aug 10, 2025
…centralize settings keys (#1900)

## Description
- Replace `Windows.Storage.ApplicationData` with
`Microsoft.Windows.Storage.ApplicationData`.
- Centralize Settings Keys in a `SettingsKeys` Class.
- define key constants in `ScratchPadPage`.

## Motivation and Context
- Closes #1892
- Closes #1893

## How Has This Been Tested?
**Manually tested**

## Screenshots (if appropriate):

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)

Co-authored-by: Niels Laute <[email protected]>
Copy link
Contributor

@Zakariathr22 Zakariathr22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few points that I think are important, but of course after hearing @marcelwgn’s opinion about them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UnPackaged Mode is Broken
3 participants